using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WiMo.Games.GameEngine.WP7S.XNA
{
    public class AssetFactory : IAssetFactory 
    {
        IGameEngine _engine;
        Microsoft.Xna.Framework.Content.ContentManager _contentManager;


        public AssetFactory(IGameEngine engine, Microsoft.Xna.Framework.Content.ContentManager contentManager)
        {
            _engine = engine;
            _contentManager = contentManager;
        }

        private AssetFactory()
        {

        }

        public WiMo.Games.Audio.IGameAudio CreateAudioInstance()
        {
            return new Audio.GameAudio(); 
        }

        public WiMo.Games.Drawables.ISpriteImage CreateSpriteImage()
        {
            var spriteImage = _engine.Display.CreateSpriteImage();
            spriteImage.Scale = _engine.Display.ScaleFactor;
            spriteImage.PhysicsManager = _engine.PhysicsManager;
            spriteImage.CollisionManager = _engine.CollisionManager;
            return spriteImage;
        }

        public WiMo.Games.Drawables.ISpriteText CreateText()
        {
            var spriteText = _engine.Display.CreateText();
            spriteText.Scale = _engine.Display.ScaleFactor;
            spriteText.PhysicsManager = _engine.PhysicsManager;
            spriteText.CollisionManager = _engine.CollisionManager;

            return spriteText;
        }

        public WiMo.Games.Drawables.ISpriteShape CreateRectangle()
        {
            var rect = _engine.Display.CreateRectangle();
            rect.Scale = _engine.Display.ScaleFactor;
            rect.PhysicsManager = _engine.PhysicsManager;
            rect.CollisionManager = _engine.CollisionManager;

            return rect;
        }

        public WiMo.Games.Drawables.ISpriteShape CreatePolygon()
        {
            var polygon = _engine.Display.CreatePolygon();
            polygon.Scale = _engine.Display.ScaleFactor;
            polygon.PhysicsManager = _engine.PhysicsManager;
            polygon.CollisionManager = _engine.CollisionManager;

            return polygon;
        }

        public WiMo.Games.Drawables.ISpriteShape CreateLineList()
        {
            var lineList = _engine.Display.CreateLineList();
            lineList.Scale = _engine.Display.ScaleFactor;
            lineList.PhysicsManager = _engine.PhysicsManager;
            lineList.CollisionManager = _engine.CollisionManager;

            return lineList;
        }

        public WiMo.Games.Drawables.ISpriteShape CreateCircle()
        {
            var ellipse = _engine.Display.CreateEllipse();
            ellipse.Scale = _engine.Display.ScaleFactor;
            ellipse.PhysicsManager = _engine.PhysicsManager;
            ellipse.CollisionManager = _engine.CollisionManager;

            return ellipse;
        }

        public WiMo.Games.Drawables.ISpriteShape CreateEllipse()
        {
            var ellipse = _engine.Display.CreateEllipse();
            ellipse.Scale = _engine.Display.ScaleFactor;
            ellipse.PhysicsManager = _engine.PhysicsManager;
            ellipse.CollisionManager = _engine.CollisionManager;

            return ellipse;
        }

        public ISpriteFont CreateFont()
        {
            return new SpriteFont();
        }

        public IContentManager CreateContentManager(IGameEngine game)
        {
            throw new NotImplementedException();
        }
    }
}